-- stack: in -- format: 8 (HyperCard 1) -- flags: 0x1000 (none) -- protect password hash: 0 -- maximum user level: 5 (scripting) -- window: Rect(x1=0, y1=0, x2=0, y2=0) -- screen: Rect(x1=0, y1=0, x2=0, y2=0) -- card dimensions: w=0 h=0 -- scroll: x=0 y=0 -- background count: 4 -- first background id: 2739 -- card count: 306 -- first card id: 68411 -- list block id: 83162 -- print block id: 70050 -- font table block id: 0 -- style table block id: 0 -- free block count: 12 -- free size: 16960 bytes -- total size: 98304 bytes -- stack block size: 7168 bytes -- created by hypercard version: 0x01228000 -- compacted by hypercard version: 0x01228000 -- modified by hypercard version: 0x01228000 -- opened by hypercard version: 0x01228000 -- patterns[0]: 0x0000000000000000 -- patterns[1]: 0x8000000008000000 -- patterns[2]: 0x8800220088002200 -- patterns[3]: 0x8888222288882222 -- patterns[4]: 0x88AA22AA88AA22AA -- patterns[5]: 0xCCAA33AACCAA33AA -- patterns[6]: 0xEEAABBAAEEAABBAA -- patterns[7]: 0xEEBBBBEEEEBBBBEE -- patterns[8]: 0xFFBBFFEEFFBBFFEE -- patterns[9]: 0xFFBBFFFFFFBBFFFF -- patterns[10]: 0x8010022001084004 -- patterns[11]: 0xFFFFFFFFFFFFFFFF -- patterns[12]: 0x8822882288228822 -- patterns[13]: 0x1122448811224488 -- patterns[14]: 0xC4800C6843023026 -- patterns[15]: 0xB130031BD8C00C8D -- patterns[16]: 0xAA00AA00AA00AA00 -- patterns[17]: 0x8822552288225522 -- patterns[18]: 0x8855225588552255 -- patterns[19]: 0x77DD77DD77DD77DD -- patterns[20]: 0x8000000000000000 -- patterns[21]: 0xAA55AA55AA55AA55 -- patterns[22]: 0x038448300C020101 -- patterns[23]: 0x8244394482010101 -- patterns[24]: 0x8814224188412214 -- patterns[25]: 0x8080413E080814E3 -- patterns[26]: 0x22048C7422179810 -- patterns[27]: 0xBE808808EB088880 -- patterns[28]: 0x25C8328964244C92 -- patterns[29]: 0x5FAAEAAA5FAAEAAA -- patterns[30]: 0x40A00000040A0000 -- patterns[31]: 0x8040200002040800 -- patterns[32]: 0xAA00800088008000 -- patterns[33]: 0xFF80808080808080 -- patterns[34]: 0x081C22C180010204 -- patterns[35]: 0xFF808080FF080808 -- patterns[36]: 0xF87422478F172271 -- patterns[37]: 0xBF00BFBFB0B0B0B0 -- patterns[38]: 0xFF7FBE5DA2418000 -- patterns[39]: 0x005FAAAAEAAAAAAA -- checksum: 0x0 ----- HyperTalk script ----- ---------------------------------------------------------------------- PLEASE NOTE: This “AreaCODE&TIMEfinder” has been registered with the Register of Copyrights, Washington, D.C. by the Kinetic Press, 1991-2. ---------------------------------------------------------------------- -- This version last modified on 1/25/92 on openStack if the version ≥ 2 then put the name of menuItem 6 of menu "File" into itemName if the first word of itemName is "Convert" then answer "This stack must be converted to work properly." && "Do you want to convert it now?" with "No" or "Yes" if it is "Yes" then doMenu itemName end if end if go to card "Title Card" put the short name of bg btn 1 of first card of bg "Main" into bname if first word of bname is not "Your" then answer "Welcome to the Area Codes stack!" with "OK" send mouseup to button "Personalize" end if DateChanged end openStack on idle put the long date into Today if Today ≠ field "LastDate" of card "Title Card" then DateChanged pass idle end idle on openCard global DSTObservedThere -- if we are on one of the data cards, adjust the DST setting for the -- place represented by this card if the short name of this bg is "Main" then put GetDSTObserved(bg field "Country Code", bg field "Area/City Code") into DSTObservedThere end if end openCard ------------------------------------------------------------------ -- Handler that is called on start or when the date changes -- It sets the global DSTSeason according to the current date ------------------------------------------------------------------ on DateChanged global DSTSeason put the long date into Today put Today into field "LastDate" of card "Title Card" -- store the date away put word 1 of item 2 of Today into Month if Month is in "May, June, July, August, September" then put "DST" into DSTSeason -- it's summer, turn on DST exit DateChanged else if Month is in "November, December, January, February, March" then put "NoDST" into DSTSeason -- it's winter, no DST exit DateChanged end if end if -- if we get this far, it is either April or October, -- need to check in more detail put item 1 of Today into Day put word 2 of item 2 of Today into Date if Month = "April" then if Date > 7 then -- after the switch to DST put "DST" into DSTSeason exit DateChanged else -- we're in the first week of April. Find out how many days -- until the next Sunday put DayToNum(Day) into DaysTilSunday if DaysTilSunday = 0 then -- Today is Sunday! DST in effect put "DST" into DSTSeason exit DateChanged else -- Figure out how many days left 'til the 7th put 7 - Date into DaysLeft if DaysLeft < DaysTilSunday then -- must be past the first Sunday put "DST" into DSTSeason else -- we are before the change put "NoDST" into DSTSeason end if exit DateChanged end if end if end if -- End of April clause -- -- if we get this far, it is October -- if Date < 25 then -- before the switch to NoDST put "DST" into DSTSeason exit DateChanged else -- we're in the last week of October. Find out how many days -- until the next Sunday put DayToNum(Day) into DaysTilSunday if DaysTilSunday = 0 then -- Today is Sunday! NoDST in effect put "NoDST" into DSTSeason exit DateChanged else -- Figure out how many days left 'til the 31st put 31 - Date into DaysLeft if DaysLeft < DaysTilSunday then -- must be past the last Sunday put "NoDST" into DSTSeason else -- we are before the change put "DST" into DSTSeason end if exit DateChanged end if end if put DSTSeason end DateChanged -- This function converts the day of the week into -- the number of days until Sunday function DayToNum theDay if theDay = "Monday" then return 6 if theDay = "Tuesday" then return 5 if theDay = "Wednesday" then return 4 if theDay = "Thursday" then return 3 if theDay = "Friday" then return 2 if theDay = "Saturday" then return 1 if theDay = "Sunday" then return 0 end DayToNum -- This function is called when the user's Area Code -- changes. It sets the Hidden fields "GMTHere" and "DSTObservedHere" -- on the Title card function AreaCodeChanged NewCode set lockScreen to true go to first card of bg "Main" find word NewCode in field "Area/City Code" if the result is empty then -- successful search put field "GMTThere" into field "GMTHere" of card "Title Card" put GetDSTObserved(bg field "Country Code", bg field "Area/City Code") into bg field "DSTObservedHere" of card "Title Card" put true into rslt else put false into rslt end if go back go back set lockScreen to false return rslt end AreaCodeChanged function GetDSTObserved CountryCode, AreaCode -- if we are in the US or Canada, use area code to decide. if CountryCode is "1" then if AreaCode is in "602,317,219,808,809" then put "NoDST" into rslt else put "DST" into rslt end if else -- we are in another country, so use country code to decide. -- if the country code of this card is NOT in the list of -- country codes that DO observe DST, then put "NoDST"... if CountryCode is not in "1,7,20,21,31,32,33,33,34,36,37,38,39,40,41"& "42,43,44,45,46,47,48,49,63,86,90,216,298"& "299,350,351,352,353,355,356,357,358,359,508"& "509,809,809,962,963,964,972" then put "NoDST" into rslt else put "DST" into rslt end if end if return rslt end GetDSTObserved